package com.baihui.taobao.vo;

import com.taobao.api.domain.Location;
import com.taobao.api.domain.Shipping;
import com.taobao.api.internal.mapping.ApiField;

/**
 * Created by Kevin.
 * User: HSZM1106-0312
 * Date: 12-1-27
 * Time: 下午5:21
 */
public class BShipping extends Shipping {
    private Long userId;

    /**
     * 详细地址，最大256个字节（128个中文）
     */
    @ApiField("address")
    private String address;

    /**
     * 所在城市（中文名称）
     */
    @ApiField("city")
    private String city;

    /**
     * 国家名称
     */
    @ApiField("country")
    private String country;

    /**
     * 区/县（只适用于物流API）
     */
    @ApiField("district")
    private String district;

    /**
     * 所在省份（中文名称）
     */
    @ApiField("state")
    private String state;

    /**
     * 邮政编码
     */
    @ApiField("zip")
    private String zip;


    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getZip() {
        return zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Override
    public void setLocation(Location location) {
        super.setLocation(location);
        if(location==null) return;
        this.address = location.getAddress();
        this.city = location.getCity();
        this.country = location.getCountry();
        this.district = location.getDistrict();
        this.state = location.getState();
        this.zip = location.getZip();
    }
}
